#include "material.h"

Material::Material()
{
    ambient= new Vectorf(0.0,0.0,0.0,1.0);
    diffuse= new Vectorf(0.2,0.2,0.2,1.0);
    specular= new Vectorf(0.5,0.5,0.5,1.0);
}

Material::Material(Vectorf *aAmbient, Vectorf *aDiffuse, Vectorf *aSpecular)
{
    ambient=aAmbient;
    diffuse=aDiffuse;
    specular=aSpecular;
}


void Material::SetAmbiant(Vectorf *vec)
{
    ambient=vec;
}

void Material::SetDiffuse(Vectorf *vec)
{
    diffuse=vec;
}

void Material::SetSpecular(Vectorf *vec)
{
    specular=vec;
}

void Material::UseMaterial()
{
    glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT, ambient->Array());
    glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse->Array());
    glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular->Array());
}
